package 一维数组;

public class 奇偶数 {
    public static void main(String[] args) {
        int[] array = {3, 2, 5, 6, 8, 4, 1, 9, 7};
        int i = 0;
        int j = 0;
        System.out.print("奇数为：");
        for (i = 0; i < array.length; i++) {
            if (array[i] % 2 != 0) {
                System.out.print(array[i] + " ");
            }
        }
        System.out.println();
        System.out.print("偶数为：");
        for (j = 0; j < array.length; j++) {
            if (array[j] % 2 == 0) {
                System.out.print(array[j] + " ");
            }
        }

    }
}